package day15.tarena.com;
public class Test {
	public static void main(String[] args) {
			int a = 2;
			int b = 0;
			if(b!= 0)     //大多数的RuntimeException都是可以避免的;
				a = a/b;   //算术异常;
			String s1 = null;
			if(s1 != null)
				s1.equals("");  //空指针异常   
			int index = 2;
			int[] arr = new int[2];
			if(index>=0 && index<arr.length)
				arr[index] = 2; //数组下标越界异常
			Object obj = "aa";
			if(obj instanceof Integer){
				Integer i = (Integer)obj; //类型转换异常
			}
			String s2 = "aabbcc";
			if(s2.matches("^\\d+$")){
				int i2 =Integer.parseInt(s2);  //数字格式异常
			}
	}
}
